package com.ctshk.rpc.finance.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ctshk.rpc.finance.entity.FinanceBillCheck;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * <p>
 * 客户对账 Mapper 接口
 * </p>
 *
 * @author 叶冠峰
 * @since 2021-03-26
 */
public interface FinanceBillCheckMapper extends BaseMapper<FinanceBillCheck> {

    /**
     * 批量删除
     * @param idList
     * @param userId
     * @return
     */
    @Update("<script>"+"UPDATE t_finance_bill_check\n" +
            "SET is_deleted = 1,modified_id = #{user_id}\n" +
            "WHERE is_deleted = 0 AND id IN "+
            "<foreach collection=\"list\" item=\"id\" index=\"index\" open=\"(\" close=\")\" separator=\",\">\n" +
            "#{id}\n" +
            "</foreach>"+
            "</script>")
    Integer batchDel(@Param("list") List<Long> idList, @Param("user_id") Long userId);
}
